package com.example.emailcraft.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.emailcraft.entity.UserTemplates;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author scj
 * @since 2025-01-21
 */
@Mapper
public interface UserTemplatesMapper extends BaseMapper<UserTemplates> {
    @Insert("INSERT INTO user_templates (user_id, title, content, category_id, created_at, updated_at) " +
            "VALUES (#{userId}, #{title}, #{content}, #{categoryId}, #{createdAt}, #{updatedAt})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void UserTemplatesInsert(UserTemplates template);
}
